using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class PatcatMap : EntityTypeConfiguration<Patcat>
    {
        public PatcatMap()
        {
            // Primary Key
            this.HasKey(t => t.plannum);

            // Properties
            this.Property(t => t.plannum)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.ATTEND_PHY)
                .IsFixedLength()
                .HasMaxLength(6);

            // Table & Column Mappings
            this.ToTable("Patcat");
            this.Property(t => t.plannum).HasColumnName("plannum");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.ATTEND_PHY).HasColumnName("ATTEND_PHY");
        }
    }
}
